package com.xcw.controller;


import com.xcw.base.config.WeChatMpConfig;
import com.xcw.entity.User;
import com.xcw.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


/**
 * @Author bhx
 * @Date 2022/8/21 0:01
 * @Description TODO
 */
@RestController
public class TestController {


    @Autowired
    UserRepository userRepository;

    @Autowired
    WeChatMpConfig weChatMpConfig;

    @GetMapping("/test")
    public List<User> test(HttpServletRequest request) {
        System.out.println(weChatMpConfig.getMpAppSecret());
        System.out.println(weChatMpConfig.getMpAppId());
        System.out.println(weChatMpConfig.getToken());
        return userRepository.findAll();
    }

}
